package com.msr.service;

import com.msr.bean.Desk;
import com.msr.mapper.DeskMapper;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tom
 * @version V1.0
 * @Package com.msr.service
 * @date 2024/1/10 9:59
 * @Copyright © 株式会社多言语系统研究所
 */
@Service
public class DeskServiceImpl implements DeskService{
    @Autowired
    private DeskMapper deskMapper;

    @Override
    public List<Desk> deskAll(String name) {
        return deskMapper.deskAll(null);
    }

    @Override
    public int saveDesk(String name) {
        Desk desk = new Desk();
        desk.setName(name);
        return deskMapper.saveDesk(desk);
    }

    @Override
    public int delDesk(int deskId) {
        return deskMapper.delDesk(deskId);
    }

    @Override
    public int changeState(Desk desk) {
        return deskMapper.changeState(desk);
    }

    @Override
    public Desk findDeskById(int id) {
        return deskMapper.findDeskById(id);
    }
}
